package com.example.coder_voucher.exception;

public class VoucherCannotBeRollbackException extends RuntimeException {
    
    public VoucherCannotBeRollbackException(String message) {
        super(message);
    }
    
    public VoucherCannotBeRollbackException(String message, Throwable cause) {
        super(message, cause);
    }
    
    public static VoucherCannotBeRollbackException alreadyUsed(String voucherCode) {
        return new VoucherCannotBeRollbackException(
            "Voucher " + voucherCode + " cannot be rolled back because it has already been used");
    }
    
    public static VoucherCannotBeRollbackException notClaimed(String voucherCode) {
        return new VoucherCannotBeRollbackException(
            "Voucher " + voucherCode + " cannot be rolled back because it was not claimed");
    }
    
    public static VoucherCannotBeRollbackException alreadyRolledBack(String voucherCode) {
        return new VoucherCannotBeRollbackException(
            "Voucher " + voucherCode + " has already been rolled back");
    }
}